FreeNestTools.
Home

Subnet, CIDR & IPv6 Calculator

Calculate subnet masks, network addresses, broadcast addresses, usable host ranges, and more for both IPv4 and IPv6. Supports CIDR notation, wildcard masks, and binary conversion.

192.168.1.0/24 10.0.0.0/8 172.16.0.0/12 /26 (64 hosts) /28 (16 hosts) /30 (4 hosts)

Subnet Details

Advertisement
[ Google AdSense Code Here ]

How to Use the Subnet & CIDR Calculator

1

Choose a Mode

Select between IPv4 Subnet, IPv6 Subnet, or CIDR Lookup using the tabs above. Each mode provides tailored subnet calculations for your networking needs.

2

Enter IP & Prefix

Type an IP address with or without CIDR notation (e.g., 192.168.1.0/24) or enter IP and prefix separately. For quick testing, click any preset button above the input field.

3

View Detailed Results

Instantly see the network address, broadcast address, usable host range, subnet mask, wildcard mask, total hosts, binary representation, and more. Results are calculated entirely in your browser.

Advertisement
[ Google AdSense Code Here ]

About the Subnet, CIDR & IPv6 Calculator

The FreeNestTools Subnet, CIDR & IPv6 Calculator is a free, privacy-first online tool that performs comprehensive subnet calculations for both IPv4 and IPv6 networks. Whether you are a network administrator planning IP allocations, a student learning subnetting, a DevOps engineer configuring cloud VPCs, or an IT professional troubleshooting connectivity, this tool provides accurate and instant subnet information.

IPv4 Subnetting — Enter any IPv4 address with a CIDR prefix (e.g., 192.168.1.0/24) to calculate the network address, broadcast address, first and last usable host IPs, subnet mask, wildcard mask, total number of hosts, usable hosts, and the binary representation showing network and host bits. The tool performs calculations using native JavaScript with no external API calls, ensuring 100% privacy.

IPv6 Subnetting — IPv6 uses 128-bit addresses with a typical /64 prefix for local networks. The tool expands compressed IPv6 addresses (e.g., 2001:db8::/32) to their full notation, calculates the network prefix, and shows both the expanded and compressed formats. Understanding IPv6 subnetting is increasingly important as IPv4 addresses become scarce and more networks transition to IPv6.

CIDR (Classless Inter-Domain Routing) replaced the traditional class-based IP addressing system (Class A, B, C) in the 1990s. CIDR allows for flexible prefix lengths (/0 through /32 for IPv4, /0 through /128 for IPv6), enabling efficient allocation of IP address space. This tool helps you understand any CIDR notation by computing all relevant subnet parameters.

Key calculations provided:

  • Network Address — the first address in the subnet, used for routing
  • Broadcast Address — the last address in the subnet, used for broadcasting to all hosts
  • Usable Host Range — IP addresses available for assigning to devices (excludes network and broadcast)
  • Subnet Mask — the dotted-decimal representation of the prefix (e.g., 255.255.255.0 for /24)
  • Wildcard Mask — the inverse of the subnet mask, used in ACLs and routing protocols
  • Total & Usable Hosts — the number of addresses and assignable addresses in the subnet
  • Binary Representation — the IP in binary with network bits and host bits color-coded

Common CIDR prefixes: /8 (255.0.0.0) — 16.7M hosts, /16 (255.255.0.0) — 65,534 hosts, /24 (255.255.255.0) — 254 hosts, /25 — 126 hosts, /26 — 62 hosts, /27 — 30 hosts, /28 — 14 hosts, /29 — 6 hosts, /30 — 2 hosts (point-to-point links). For IPv6, /64 is the standard subnet size providing 264 addresses.

To determine required bandwidth for your network, check the Bandwidth Calculator.

Privacy guarantee: All subnet calculations are performed entirely in your browser using client-side JavaScript. No IP addresses, subnet data, or any other information is transmitted to our servers or any third-party service. Your network designs remain completely private. No registration, account creation, or personal information is required.

Use cases: Network infrastructure planning, firewall rule configuration, VPC subnet design for AWS/Azure/GCP, DHCP scope planning, network documentation, CCNA/Network+ exam preparation, IP address management (IPAM), and general network education.

Frequently Asked Questions

CIDR (Classless Inter-Domain Routing) notation is a compact method of specifying an IP address and its associated subnet mask. It uses the format IP/prefix, where the prefix is the number of consecutive 1-bits in the subnet mask. For example, 192.168.1.0/24 means the IP address is 192.168.1.0 with a subnet mask of 255.255.255.0 (24 network bits and 8 host bits). CIDR was introduced in 1993 to replace the rigid class-based addressing system (Class A, B, C) and to slow the growth of routing tables. It allows network administrators to create subnets of any size, making IP address allocation much more efficient. CIDR is now the standard method for IP address assignment and routing on the internet.

The formula for calculating the number of usable hosts in a subnet is: 2(32 - prefix) - 2 for IPv4. You subtract 2 from the total to exclude the network address (all host bits 0) and the broadcast address (all host bits 1). For example, a /24 subnet has 28 - 2 = 254 usable hosts. A /26 subnet has 26 - 2 = 62 usable hosts. A /30 subnet has 22 - 2 = 2 usable hosts (ideal for point-to-point links between routers). For /31 subnets, RFC 3021 allows using both addresses (no network/broadcast), giving 2 usable hosts for point-to-point links. For /32, only one host is available.

A subnet mask separates the network portion from the host portion of an IP address. It consists of consecutive 1-bits for the network portion followed by 0-bits for the host portion (e.g., 255.255.255.0 = 24 ones + 8 zeros). A wildcard mask is the bitwise inverse of the subnet mask: 0-bits for network and 1-bits for host (e.g., 0.0.0.255). Wildcard masks are used in Cisco ACLs (Access Control Lists), OSPF routing protocol configurations, and certain network filtering scenarios. To calculate a wildcard mask, simply subtract each octet of the subnet mask from 255: 255.255.255.0 becomes 0.0.0.255.

To find the network address: perform a bitwise AND between the IP address and the subnet mask. All host bits become 0, leaving only the network portion. In binary, wherever the mask has a 1, the IP bit is kept; wherever the mask has a 0, the result is 0. To find the broadcast address: take the network address and set all host bits to 1. Alternatively, add (2host_bits - 1) to the network address integer. For example, with 192.168.1.42/26: the mask is 255.255.255.192, the network address is 192.168.1.0, and the broadcast address is 192.168.1.63. Usable hosts are 192.168.1.1 through 192.168.1.62.

Yes, the FreeNestTools Subnet, CIDR & IPv6 Calculator is 100% free with no hidden costs, no registration requirements, no API keys, and no usage limits. All calculations are performed entirely in your browser using client-side JavaScript. You can run as many subnet calculations as you need, for both personal and professional use. There are no premium features behind a paywall — everything is accessible to everyone. No account creation or email address is required.

The standard subnet size for IPv6 is /64. This provides 264 addresses per subnet — an astronomically large number (approximately 18.4 quintillion). IANA (Internet Assigned Numbers Authority) recommends /64 as the default prefix length for all general-purpose IPv6 subnets. This is because IPv6 features like SLAAC (Stateless Address Autoconfiguration) require a /64 prefix to function properly, as the interface identifier (the host portion) is typically 64 bits derived from the MAC address or generated randomly. Common IPv6 allocations: /32 for ISPs, /48 for enterprise sites, /56 for consumer broadband, and /64 for individual subnets. Unlike IPv4, there is no broadcast address in IPv6; the all-hosts multicast address is used instead.

IPv6 address compression follows RFC 5952 rules. An IPv6 address like 2001:0db8:0000:0000:0000:8a2e:0370:7334 can be shortened in two ways: 1) Leading zero suppression — remove all leading zeros in each block (e.g., 0db8db8, 0370370). 2) Zero compression — replace the longest consecutive run of all-zero blocks with :: (only once). So 2001:0db8:0000:0000:0000:8a2e:0370:7334 becomes 2001:db8::8a2e:370:7334. Our tool automatically performs both expansion (converting compressed addresses to full notation) and compression for you.

The binary representation shows the IP address in 32-bit (IPv4) or 128-bit (IPv6) binary format, color-coded to distinguish network bits (shown in purple) from host bits (shown in teal). This visual breakdown helps you understand exactly how the subnet mask divides the address space. Network bits (1s in the subnet mask) remain fixed for all devices in the same subnet, while host bits (0s in the subnet mask) can vary to assign individual addresses. For example, in 192.168.1.0/24, the first 24 bits (192.168.1) are the network portion and the last 8 bits (.0) are the host portion. This binary view is invaluable for learning subnetting and understanding how routers determine whether an address belongs to the local network or a remote network.

The right CIDR prefix depends on how many hosts you need in each subnet. Here is a quick reference: /30 (2 usable hosts) — point-to-point links between routers. /29 (6 usable hosts) — small DMZs or management networks. /28 (14 usable hosts) — small VLANs or remote office segments. /27 (30 usable hosts) — medium-sized network segments. /26 (62 usable hosts) — typical department or floor segment. /25 (126 usable hosts) — larger building or campus segment. /24 (254 usable hosts) — the most commonly used subnet size for general networks. /23 (510 usable hosts) — for larger networks needing more than 254 hosts. /22 (1,022 usable hosts) and larger prefixes are used for data centers and major network segments. Always plan for future growth — it is better to use a slightly larger subnet than you need today. Our tool helps you see the exact host count for any prefix length.

Yes, absolutely. The Subnet & CIDR Calculator fully supports IPv6. Enter an IPv6 address in compressed or expanded form with a prefix length (e.g., 2001:db8::/32 or 2001:0db8:85a3:0000:0000:8a2e:0370:7334/64). The tool will calculate the network prefix, show both the expanded (full 32-hex-digit) and compressed (shortened) forms of the address, and display the binary pattern. IPv6 subnetting is essential for modern network design as the world transitions from IPv4. Key differences from IPv4: IPv6 does not have broadcast addresses, the standard subnet size is /64, and addresses are written in hexadecimal colon notation. This tool helps you understand these differences and plan your IPv6 addressing scheme.

Total hosts is the total number of IP addresses in the subnet, calculated as 2(32 - prefix) for IPv4. This includes all addresses in the range. Usable hosts excludes the network address (where all host bits are 0) and the broadcast address (where all host bits are 1), so it is 2(32 - prefix) - 2. For example, a /24 subnet has 256 total addresses but only 254 usable addresses. The network address (.0) is reserved to identify the subnet itself, and the broadcast address (.255) is reserved for sending packets to all devices on the subnet. For /31 subnets, RFC 3021 eliminates the concept of network and broadcast addresses for point-to-point links, making both addresses usable, which gives 2 usable hosts despite the formula giving 0. For /32, only one host is available.

Yes, 100% private. All subnet calculations are performed entirely in your browser using client-side JavaScript. The IP addresses, CIDR notations, and subnet data you enter never leave your device. We do not send any data to servers, APIs, or third-party services. There are no tracking scripts, analytics, or data collection mechanisms associated with this tool. No cookies are used. You do not need to create an account, provide an email address, or register in any way. Your network designs, internal IP addressing schemes, and subnet planning remain completely confidential. This privacy-first approach is a core principle of FreeNestTools — all our tools process data locally in your browser.

Subnetting has numerous practical applications in real-world networking: 1) Network segmentation — dividing a large network into smaller subnets improves performance by reducing broadcast traffic and collision domains. 2) Security — separating different departments (HR, Finance, Engineering) into different subnets allows firewall rules and access controls between them. 3) IP address conservation — subnetting prevents wasting IP addresses by matching subnet sizes to actual host counts. 4) Cloud VPC design — on AWS, Azure, and GCP, you create VPCs with subnets across availability zones for high availability. 5) Route summarization — contiguous subnets can be summarized into a single route advertisement, reducing routing table size. 6) VPN and remote access — assigning dedicated subnets for VPN clients or remote offices. 7) CCNA/Network+ certification — subnetting is a core skill tested in all major networking certifications. Our calculator helps with all these scenarios.

The binary output displays the IP address as a series of 32 binary digits (for IPv4) or 128 binary digits (for IPv6), color-coded for clarity: Purple bits represent the network portion (bits covered by the subnet mask, set to 1 in the mask). Teal bits represent the host portion (bits NOT covered by the subnet mask, set to 0 in the mask). For example, with 192.168.1.0/24, the binary shows: 11000000 10101000 00000001 00000000. The first 24 bits (purple) are the network prefix, and the last 8 bits (teal) are available for host addressing. To find the network address, look at the bits where the mask is 1. To find the broadcast address, set all teal bits to 1.

A /31 subnet provides a subnet mask of 255.255.255.254 with exactly 2 IP addresses (0 usable by the traditional formula, but both are usable per RFC 3021). /31 subnets are specifically designed for point-to-point links between routers. Normally, a point-to-point link using /30 wastes 2 of the 4 addresses (network, broadcast, and only 2 usable). With /31, both addresses are used for the two router interfaces, eliminating waste. RFC 3021 allows the use of /31 subnets on point-to-point links. When you configure a /31 on a Cisco interface, there is no network or broadcast address — both addresses are valid host addresses. Many ISPs use /31 subnets for their router-to-router connections. Our calculator handles /31 subnets correctly, showing both addresses as usable.
Advertisement
[ Google AdSense Code Here ]